#ifndef EVENTSHANDLER_H
#define EVENTSHANDLER_H

#include <QDate>
#include <QTime>

struct Event
{
    QString description;
    QDateTime dateTime;
    QDateTime alarmDateTime;
    QTime alarmTime;
public:
    void editEvent(Event *A, Event B);
};

struct EventList
{
    Event Data;
    EventList *next;
    EventList(): next(NULL) {}
};

class EventsHandler
{
public:
    EventsHandler();
    EventList* FindEventsByDate(QDate date);
    void AddEvent(QDate date, QTime time, QString descr);
    void AddEvent(Event dt);
    void showList();
    void saveList();
    void loadList();
    int GetAllDates(QDateTime A[]);
    int GetAllAlarmTimes(QDateTime A[]);
    Event* GetEvent(Event A);
    Event GetEvent(QDateTime alarmTime);
    void RemoveEvent(Event *A);
    void editEvent(Event *A, Event B);
private:
    EventList *First;
};

#endif // EVENTSHANDLER_H
